PANTHEON™ manual

 Categories
 PANTHEON Help - Welcome
[Collapse]PANTHEON
 [Collapse]Guides for PANTHEON
  [Collapse]Guide for PANTHEON
   [Collapse]Settings
    [Expand]Subjects
    [Expand]Items
    [Expand]POS
    [Expand]Manufacturing
    [Expand]Personnel
     Calendar
    [Expand]Financials
    [Expand]Customs
    [Collapse]Program
     [Expand]Document Types
     [Collapse]Reports in PANTHEON
       Settings in Administration Panel
      [Expand]Reports Register
       Print Preview
      [Expand]Report Designer
      [Expand]Creating Reports
      [Expand]Groups and Aggregates
      [Expand]Formatting and Highlighting
       Nested Reports (Subreports)
      [Collapse]Script
        "Hello, World!" Script
        Using Variables, Database Fields, and Aggregate Functions
        Using Report Objects in the Script
        Events
        Example of Using the "OnBeforePrint" Event
        Printing a Group Sum in the Group Header
        Running Total
        "OnAfterData" Event
        Service Objects
        Using the "Engine" Object
       [Expand]PANTHEON Functions for FastReport
       [Expand]Examples with Tables and Queries
      [Expand]Specifics of Printouts in PANTHEON
       Report Design Considerations
      Document Texts
      Delivery Methods
     [Expand]Loyalty Cards
     [Expand]Administration Panel
     [Expand]Dashboard Components
      Dashboard Reports
      Ad-hoc analysis
     [Expand]ARES
      SQL urejevalnik
    [Expand]Documentation
    [Expand]Change User
   [Expand]Orders
   [Expand]Goods
   [Expand]Manufacturing
   [Expand]POS
   [Expand]Service
   [Expand]Financials
   [Expand]Personnel
   [Expand]Analytics
   [Expand]Desktop
   [Expand]Help
   [Expand]Messages and Warnings
   [Expand]Additional programs
   [Expand]Old products
  [Expand]Guide for PANTHEON Retail
  [Expand]Guide for PANTHEON Vet
  [Expand]Guide for PANTHEON Farming
 [Expand]User Manuals for PANTHEON
[Expand]PANTHEON Web
[Expand]PANTHEON Granules
[Expand]User Site

Load Time: 781.2629 ms
print   |
Label

"OnAfterData" Event

"OnAfterData" Event

This event is triggered after a report object has been filled with the data from the source to which it is connected. Use this event for accessing either a database field value or an expression contained in the object. This value is placed in the “Value” system variable which is available only in this event. So if two “Text” objects contain the expressions [Table1.“Field1”] and [<Table2.“Field1”> + 10] the values of these expressions can be used by referring to the “Value” variable for the objects:

if Value > 3000 then

  Memo1.Color := clRed

which is simpler than writing something like this:

if <Table1."Field1"> > 3000 then

  Memo1.Color := clRed

Using “Value” instead of an expression enables you to write one multi-purpose handler for the “OnAfterData” event which can be connected to several objects.

Please note something else - if an object contains several expressions (for example '[expr1] [expr2]') it is the value of the last expression that is transferred to the “Value” variable.

The “OnAfterData” event is ideal for calculating the height and width of objects such as “Text”. That is, if the exact height of a stretched “Text” object containing an expression is needed in a script you can use this code in the “OnAfterData” event:

var

  MemoHeight: Extended;                                                        

begin

  MemoHeight := TfrxMemoView(Sender).CalcHeight;                                    

end;

If this code were used in the “OnBeforePrint” event the result will be the height of the object containing the expression before the expression is evaluated, and not its actual value on printing.



Rate this topic
Was this topic usefull?
Comments
Comment will also bo visible in forum!